<% add_decidim_page_title(t("pages", scope: "decidim.admin.titles")) %>

<div class="item_show__header">
  <h1 class="item_show__header-title">
    <%= t("pages", scope: "decidim.admin.titles") %>
    <% if allowed_to? :create, :static_page %>
      <%= link_to t("static_pages.new.create", scope: "decidim.admin"), [:new, :static_page], class: "button button__sm button__secondary expanded small new" %>
    <% end %>
  </h1>
</div>

<% @topics.each do |topic| %>
  <%= render partial: "topic", locals: { pages: topic.pages, topic: } %>
<% end %>

<% if @orphan_pages.any? %>
  <div class="mt-4">
    <%= render partial: "topic", locals: { pages: @orphan_pages, topic: nil } %>
  </div>
<% end %>
